<script setup>

// 子组件接收父组件传递的信息
defineProps({ 
  message: String,
  number: Number
})

// 通过 defineEmits 编译器宏生成 emit
const emit = defineEmits(['changeNum'])

const numberSub = () => {
  emit('changeNum',1)
}

</script>

<template>
  <button @click="numberSub" class="myButton">{{ message }}{{ number }}</button>
</template>

<style scoped>
  .myButton {
    padding: 10px 30px;
    background-color: #63ccf6;
    border: 1px #0a8fff solid;
    color: white;
    border-radius: 5px;
  }
</style>